<table id='billTable'>
  <tr>
    <th>Name</th>
    <th>Company</th>
    <th>Sale cost</th>
    <th>Tax%</th>
    <th>CM%</th>
    <th>Quantity</th>
    <th>Total</th>
  </tr>
  <tr id="template">
    <td class ="name"></td>
    <td class="company"></td>
    <td><input class="cost" type="text" placeholder="Numbers" ></td>
    <td><input class="itemQuantity" type="text" placeholder="Numbers" ></td>
    <td class="total"></td>
  </tr>
  <% Sold.find_all_by_ref_id(@bill.ref_id).each do |sold| %>
    <tr sold_id="<%= sold.id%>">
    <% @stock = Stock.find(sold.stock_id)%>
    <td class ="name"><%= @stock.name %></td>
    <td class="company"><%= @stock.company%></td>
    <td><input class="cost" type="text" placeholder="Numbers" value="<%= sold.cost%>" ></td>
    <td><input class="itemQuantity" type="text" placeholder="Numbers" value="<%= sold.quantity %>" ></td>
    <td><input class="tax_percentage" type="text" value="<%= sold.tax_percentage %>" ></td>
    <td><input class="commission_percentage" type="text" value="<%= sold.commission_percentage %>" ></td>
    <td class="total"></td>
  </tr>
<% end %>
</table>
